<template>
  <div :class="'bundle-item '+(viewType == 'two' ? 'two' : '' )">
    <div class="bundle-img">
      <img  v-lazy="img_url+banner">
    </div>
    <div class="bundle-content">
      <h4 class="bundle-title shuang wordBreak">{{title}}</h4>
      <div class="bundle-bottom">
        <span class="bundle-price">{{price}}</span>
        <p class="bun-num">包含{{courseNumbers}}门课程</p>
      </div>
    </div>
  </div>
</template>
<script>
import { mapState } from "vuex";
export default {
  props: {
    viewType: {
      type: String,
      default: "one"
    },
    // 标题
    title: {
      type: String,
      default: ""
    },
    // 图片
    banner: {
      type: String,
      default: ""
    },
    // 课程数量
    courseNumbers: {
      type: Number,
      default: 0
    },
    // 价格
    price: {
      type: String,
      default: ""
    }
  },
  data() {
    return {};
  },
  computed: {
    ...mapState(["img_url"])
  },
  methods: {}
};
</script>

<style scoped lang="scss">
.bundle-item {
  width: 100%;
  border-radius: 0.04rem;
  &.two {
    width: 2.7rem;
    .bundle-img img {
      width: 2.7rem;
      height: 1.52rem;
    }
  }

  .bundle-img {
    img {
      width: 3.51rem;
      height: 1.98rem;
      border-radius: 0.04rem 0.04rem 0 0;
    }
  }

  .bundle-content {
    padding: 10px 12px 12px;
    background-color: #fff;
    border-radius: 0 0 0.04rem 0.04rem;
  }

  .bundle-title {
    font-size: 0.14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 0.2rem;
  }
  .bundle-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.04rem;
    .bun-num {
      font-size: 0.12rem;
      color: #909399;
      line-height: 0.17rem;
    }
    .bundle-price {
      font-size: 0.14rem;
      color: #0486fe;
      line-height: 0.17rem;
    }
  }
}
</style>


